Ext.define('App.reportconfiguration.view.ReportConfigurationEditor', {
    extend: 'Extend.window.FormWindow',
    alias: 'widget.ReportConfigurationEditor',
    requires: ['App.reportconfiguration.view.field.ReportConfigurationTypeCombobox',
        'App.reportconfiguration.view.field.ReportConfigurationKpiGridField',
        'App.reportconfiguration.view.field.ChartConfigurationGridField',
        'App.reportconfiguration.model.ReportConfigurationKpiModel'],
    config: {
        entity: 'reportConfiguration',
        defaults: {
            columnWidth: 1,
            labelWidth: 60
        },
        window: {
            title: '报表配置编辑',
            width: 1000,
            height: 600,
            resizable: false
        }
    },
    items: [{
        xtype: 'textfield',
        name: 'id',
        hidden: true
    }, {
        xtype: 'textfield',
        name: 'name',
        columnWidth: 0.4,
        fieldLabel: '名称',
        allowBlank: false,
        blankText: '名称为必填字段，不能为空！',
        beforeLabelTextTpl: ['<span style="color:red;">*</span>']
    }, {
        xtype: 'ReportConfigurationTypeCombobox',
        name: 'type',
        columnWidth: 0.3,
        fieldLabel: '类型',
        allowBlank: false,
        blankText: '类型为必填字段，不能为空！',
        beforeLabelTextTpl: ['<span style="color:red;">*</span>']
    }, {
        xtype: 'booleancombobox',
        name: 'forceFit',
        columnWidth: 0.3,
        labelWidth: 70,
        fieldLabel: '列自适应',
        value: true
    }, {
        xtype: 'textarea',
        name: 'description',
        fieldLabel: '描述'
    }, {
        xtype: 'tabpanel',
        height: 400,
        items: [{
            xtype: 'ReportConfigurationKpiGridField',
            title: '指标配置',
            model: 'App.reportconfiguration.model.ReportConfigurationKpiModel',
            name: 'kpis'
        }, {
            xtype: 'ChartConfigurationGridField',
            title: '图配置',
            model: 'App.reportconfiguration.model.ReportConfigurationKpiModel',
            name: 'chartConfigurations'
        }]
    }]
})
